package com.kingsoft.dc.khaos

/**
  * Created by haorenhui on 2020/07/01.
  */
class ValuesChannel {

    private var _valuesChannel = Map[String,Any]()

    def emit[T](valuesName: String, valuesValue: T): Unit = {

        _valuesChannel +=(valuesName -> valuesValue)
    }

    def getValues[T](valuesName: String): T ={
        _valuesChannel.get(valuesName).map(_.asInstanceOf[T]).get
    }

    def remove(valuesName : String):Unit ={
        _valuesChannel = _valuesChannel - valuesName
    }

    def list(): Seq[String] = _valuesChannel.keys.toSeq
}
